#define _CRT_SECURE_NO_WARNINGS 1

int* selfDividingNumbers(int left, int right, int* returnSize) {
    int* result = (int*)malloc((right - left + 1) * sizeof(int));
    int count = 0;
    int num = 0;
    for (num = left; num <= right; num++)
    {
        int num1 = num;
        while (num1)
        {
            int i = num1 % 10;
            if (i != 0 && num % i == 0)
                num1 /= 10;
            else
                break;
        }
        if (num1 == 0)
        {
            result[count] = num;
            count++;
        }
    }
    *returnSize = count;
    return result;
}